using System;
using System.Collections;
using System.Collections.Generic;
using TGame.UI;
using UnityEngine;

namespace Koakuma.Game.UI
{
    public class GenieUIMediator : UIMediator<GenieUIView>
    {
        protected override void OnShow(object arg)
        {
            base.OnShow(arg);
            view.btnClose.onClick.AddListener(Close);
           view.baggenie.onClick.AddListener(OpenBagUI);
            view.bagClose.onClick.AddListener(CloseBaglUI);

        }

        private void CloseBaglUI()
        {
            SetBagVisibile(false);
        }

        private void SetBagVisibile(bool v)
        {
           view.bagimage.SetActive(v);
        }

        private void OpenBagUI()
        {
            SetBagVisibile(true);
        }

        protected override void OnHide()
        {
            view.btnClose.onClick.RemoveListener(Close);
            base.OnHide();
        }
    }
    
}

